# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pefile
_pkgname=pefile
pkgver=2019.4.18
pkgrel=5
pkgdesc='Python PE parsing module.'
arch=('any')
url='https://pypi.org/project/pefile/#files'
license=('MIT')
depends=('python2' 'python2-future')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
        'UserDB.TXT'
        'userdb.txt')
sha512sums=('33c53120fd6a0fde22f4076c19ed8f69fc2b53b16d0c581133446d0d770e290dcb2ddd1e9941e8d8debc28c1cb4ff64ff055c2b8c0958015d9121de72ae20c76'
            '3db3041768285f664eb42319e4c7a18e4a5a1c0731d806a8e7a4070d086395727ad5cba292f81db5ba9f6de7f244f34594b7379d32234fa01380083966874809'
            '852fed6728f84203bb39d4538699217446156d8e4bf60e8498bdaa97a853fd1b6605864bf3bba3535fbcbdc54ebee5624500356cf2bd46015de3ff31c9a51e19')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {

  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/${pkgname[0]}/" ../UserDB.TXT \
    ../userdb.txt
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/${pkgname[0]}/LICENSE"
}

